/**
 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.triumphsys.icici.cmeeting.portlet.model;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.model.impl.BaseModelImpl;

import java.io.Serializable;

import java.lang.reflect.Proxy;

/**
 * @author Triumphsys
 */
public class CMForumClp extends BaseModelImpl<CMForum> implements CMForum {
	public CMForumClp() {
	}

	public long getPrimaryKey() {
		return _forumId;
	}

	public void setPrimaryKey(long pk) {
		setForumId(pk);
	}

	public Serializable getPrimaryKeyObj() {
		return new Long(_forumId);
	}

	public long getForumId() {
		return _forumId;
	}

	public void setForumId(long forumId) {
		_forumId = forumId;
	}

	public long getEntityId() {
		return _entityId;
	}

	public void setEntityId(long entityId) {
		_entityId = entityId;
	}

	public String getName() {
		return _name;
	}

	public void setName(String name) {
		_name = name;
	}

	public String getDescription() {
		return _description;
	}

	public void setDescription(String description) {
		_description = description;
	}

	public long getGroupId() {
		return _groupId;
	}

	public void setGroupId(long groupId) {
		_groupId = groupId;
	}

	public boolean getActive_() {
		return _active_;
	}

	public boolean isActive_() {
		return _active_;
	}

	public void setActive_(boolean active_) {
		_active_ = active_;
	}

	public CMForum toEscapedModel() {
		if (isEscapedModel()) {
			return this;
		}
		else {
			return (CMForum)Proxy.newProxyInstance(CMForum.class.getClassLoader(),
				new Class[] { CMForum.class }, new AutoEscapeBeanHandler(this));
		}
	}

	public Object clone() {
		CMForumClp clone = new CMForumClp();

		clone.setForumId(getForumId());
		clone.setEntityId(getEntityId());
		clone.setName(getName());
		clone.setDescription(getDescription());
		clone.setGroupId(getGroupId());
		clone.setActive_(getActive_());

		return clone;
	}

	public int compareTo(CMForum cmForum) {
		int value = 0;

		if (getForumId() < cmForum.getForumId()) {
			value = -1;
		}
		else if (getForumId() > cmForum.getForumId()) {
			value = 1;
		}
		else {
			value = 0;
		}

		if (value != 0) {
			return value;
		}

		return 0;
	}

	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}

		CMForumClp cmForum = null;

		try {
			cmForum = (CMForumClp)obj;
		}
		catch (ClassCastException cce) {
			return false;
		}

		long pk = cmForum.getPrimaryKey();

		if (getPrimaryKey() == pk) {
			return true;
		}
		else {
			return false;
		}
	}

	public int hashCode() {
		return (int)getPrimaryKey();
	}

	public String toString() {
		StringBundler sb = new StringBundler(13);

		sb.append("{forumId=");
		sb.append(getForumId());
		sb.append(", entityId=");
		sb.append(getEntityId());
		sb.append(", name=");
		sb.append(getName());
		sb.append(", description=");
		sb.append(getDescription());
		sb.append(", groupId=");
		sb.append(getGroupId());
		sb.append(", active_=");
		sb.append(getActive_());
		sb.append("}");

		return sb.toString();
	}

	public String toXmlString() {
		StringBundler sb = new StringBundler(22);

		sb.append("<model><model-name>");
		sb.append("com.triumphsys.icici.cmeeting.portlet.model.CMForum");
		sb.append("</model-name>");

		sb.append(
			"<column><column-name>forumId</column-name><column-value><![CDATA[");
		sb.append(getForumId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>entityId</column-name><column-value><![CDATA[");
		sb.append(getEntityId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>name</column-name><column-value><![CDATA[");
		sb.append(getName());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>description</column-name><column-value><![CDATA[");
		sb.append(getDescription());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>groupId</column-name><column-value><![CDATA[");
		sb.append(getGroupId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>active_</column-name><column-value><![CDATA[");
		sb.append(getActive_());
		sb.append("]]></column-value></column>");

		sb.append("</model>");

		return sb.toString();
	}

	private long _forumId;
	private long _entityId;
	private String _name;
	private String _description;
	private long _groupId;
	private boolean _active_;
}